function selectAllChkbox(obj, chkbox) {
    //被选中
    if (obj.checked) {
        selectAll(chkbox, true);
        return;
    }
    //未选中
    selectAll(chkbox, false);
}

//全选/全不选
function selectAll(chkbox, isChecked) {
    var boxName = document.getElementsByName(chkbox);
    for (var i = 0; i < boxName.length; i++) {
        boxName[i].checked = isChecked;
    }
}